#include "newcharacterdialog.h"
#include "ui_newcharacterdialog.h"

CNewCharacterDialog::CNewCharacterDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::newCharacterDialog),pNewChar(NULL)
{
    ui->setupUi(this);
    initializeDropdown();
}

CNewCharacterDialog::~CNewCharacterDialog()
{
    delete ui;
    delete pNewChar;
}

void CNewCharacterDialog::initializeDropdown()
{
    const char** p = Diablo3::DEFAULTCLASSNAMES;
    for(int i = 0;i<Diablo3::MAXCLASSES;i++,p++)
        ui->classBox->addItem(QApplication::translate("Diablo3",*p));
    ui->classBox->adjustSize();
}

void CNewCharacterDialog::on_buttonBox_accepted()
{
    delete pNewChar;
    pNewChar = NULL;
    pNewChar = new CCharacter(ui->classBox->currentText()
                              );
}

void CNewCharacterDialog::on_buttonBox_rejected()
{
    delete pNewChar;
    pNewChar = NULL;
}

void CNewCharacterDialog::on_browseBtn_clicked()
{

}
